<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
	<meta charset="UTF-8">
	<title>斐波那契数列~</title>
	<style>
		.box{
			position: relative;
		}
		.duf{
			position: absolute;
			top: 0;
			left: 0;
			border:1px solid #dddddd;
		}
	</style>
</head>
<body>
<h1 id="h1">{{name}}</h1>
<div class="box"></div>

<script>

// 猜猜看~
function fn(n){
	if(n<=2){
		return 1;
	}else{
		return fn(n-1)+fn(n-2);
	}
}

function fibonacci(num){
	var cat = '';
	for(var i=1;i<=num ; i++){
		var ber = fn(i);
		cat+= '<div class="duf" style="width:'+ ber +'px;height:'+ ber +'px"></div>'
	}
	document.getElementsByClassName('box')[0].innerHTML = cat;
}
fibonacci(16);

</script>
</body>
</html>